﻿using System.ComponentModel;
using System.Runtime.CompilerServices;

namespace FileTransSystem.ViewModel
{
    public class SelectableViewModel : INotifyPropertyChanged
    {
        private bool _isSelected;
        private string _fileName;
        private string _uploadTime;
        private string _fileSize;
        private string _fileMD5;
        private string _filePath;

       

        public bool IsSelected
        {
            get => _isSelected;
            set
            {
                if (_isSelected == value) return;
                _isSelected = value;
                OnPropertyChanged();
            }
        }
        

        public string FileName
        {
            get => _fileName;
            set
            {
                if (_fileName == value) return;
                _fileName = value;
                OnPropertyChanged();
            }
        }
        
        public string FileSize
        {
            get => _fileSize;
            set
            {
                if (_fileSize == value) return;
                _fileSize = value;
                OnPropertyChanged();
            }
        }

        public string FileMd5
        {
            get => _fileMD5;
            set
            {
                if (_fileMD5 == value) return;
                _fileMD5 = value;
                OnPropertyChanged();
            }
        }

        public string OwnedBy
        {
            get => _ownedBy;
            set
            {
                if (_ownedBy == value) return;
                _ownedBy = value;
                OnPropertyChanged();
            }
        }

        public string UploadUser
        {
            get => _uploadUser;
            set
            {
                if (_uploadUser == value) return;
                _uploadUser = value;
                OnPropertyChanged();
            }
        }

        private string _ownedBy;
        private string _uploadUser;

        public string UploadTime
        {
            get => _uploadTime;
            set
            {
                if (_uploadTime == value) return;
                _uploadTime = value;
                OnPropertyChanged();
            }
        }

       
        public string FilePath
        {
            get => _filePath;
            set
            {
                if (_filePath == value) return;
                _filePath = value;
                OnPropertyChanged();
            }
        }
        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}